package org.wu.framework.authorization.platform.infrastructure.converter;


import org.wu.framework.authorization.platform.infrastructure.entity.SysRoleMenuDO;
import org.wu.framework.authorization.platform.domain.model.sys.role.menu.SysRoleMenu;
import org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureConverter;

/**
 * describe 角色菜单
 *
 * @author Jia wei Wu
 * @date 2023/05/17 11:19 晚上
 * @see DefaultDDDLazyInfrastructureConverter
 **/

public class SysRoleMenuConverter {


    /**
     * describe 实体对象 转换成领域对象
     *
     * @param
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/
    public static SysRoleMenu toRoleMenu(SysRoleMenuDO sysRoleMenuDO) {
        if (null != sysRoleMenuDO) {
            SysRoleMenu sysRoleMenu = new SysRoleMenu();
            sysRoleMenu.setCreateTime(sysRoleMenuDO.getCreateTime());
            sysRoleMenu.setId(sysRoleMenuDO.getId());
            sysRoleMenu.setIsDeleted(sysRoleMenuDO.getIsDeleted());
            sysRoleMenu.setMenuId(sysRoleMenuDO.getMenuId());
            sysRoleMenu.setRoleId(sysRoleMenuDO.getRoleId());
            sysRoleMenu.setUpdateTime(sysRoleMenuDO.getUpdateTime());
            return sysRoleMenu;
        }
        return null;
    }

    /**
     * describe 领域对象 转换成实体对象
     *
     * @param
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/
    public static SysRoleMenuDO fromRoleMenu(SysRoleMenu sysRoleMenu) {
        if (null != sysRoleMenu) {
            SysRoleMenuDO sysRoleMenuDO = new SysRoleMenuDO();
            sysRoleMenuDO.setCreateTime(sysRoleMenu.getCreateTime());
            sysRoleMenuDO.setId(sysRoleMenu.getId());
            sysRoleMenuDO.setIsDeleted(sysRoleMenu.getIsDeleted());
            sysRoleMenuDO.setMenuId(sysRoleMenu.getMenuId());
            sysRoleMenuDO.setRoleId(sysRoleMenu.getRoleId());
            sysRoleMenuDO.setUpdateTime(sysRoleMenu.getUpdateTime());
            return sysRoleMenuDO;
        }
        return null;
    }

}